﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using DataAccess;
namespace SQT.tracnghiem.Ajax.ASP
{
    public partial class edit_avatar1 : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            int id = int.Parse(Session["user_id"].ToString());
            string temp = Request.QueryString["img"];
            string img = temp.Split('\\')[temp.Split('\\').Length - 1];
            string temp2 = img;
            img = DateTime.Now.Day.ToString() + DateTime.Now.Month.ToString() + DateTime.Now.Year.ToString() + DateTime.Now.Hour.ToString() + DateTime.Now.Minute.ToString();
            img += Session["user_id"].ToString() + temp2;

            var get_user = new TblUserController().FetchAll().Where(x => x.UserId == id).Single();

            new TblUserController().Update(id,get_user.NumberStudy, get_user.UserName, get_user.UserPass, get_user.FullName, get_user.BirthDay, get_user.Phone, img, get_user.Email, get_user.AddressMail, get_user.Address, get_user.Facebook, get_user.Sex, get_user.UserLevel,get_user.ClassX, get_user.Active, get_user.SignInDate, get_user.Wallpaper, get_user.Note);
        }
    }
}